package ynu.lcy.controller.inner;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import ynu.lcy.elememicroserviceserviceclient.service.CartFeignClient;

import ynu.lcy.entity.Cart;
import ynu.lcy.service.CartService;

import javax.annotation.Resource;

/**
 *  购物车内部服务，前端不可调用
 * */
@RestController
@RequestMapping("/cart/inner")
public class CartInnerController implements CartFeignClient {

    @Resource
    private CartService service;

    /**
     * 获取购物车信息
     * @param cartId 购物车id
     * */
    @GetMapping("/get")
    @Override
    public Cart get(@RequestParam("cartId") long cartId) {
        return service.get(cartId);
    }
}
